#!/usr/bin/env python  
# encoding: utf-8


""" 
@version: v1.0 
@author: Shylock 
@license: Apache Licence  
@contact: JYFelt@163.com 
@site: http://blog.csdn.net/weixin_38034182 
@software: PyCharm Community Edition 
@file: MainPage.py 
@time: 2017/12/22 11:27 
"""
from tkinter import *
from InfoPage import *


class MainPage(object):
    def __init__(self, master=None):
        self.root = master  # 定义内部变量
        self.root.geometry('620x350')  # 设置窗口大小
        self.ChoosePage()

    def ChoosePage(self):
        self.page = Frame(self.root)
        self.page.pack()
        self.Button = self.Button()

    def Button(self):
        b1 = Button(self.page, text='插入信息', font='黑体', command=self.jump_1)
        b1.configure(width=30, height=8, fg='red')
        b1.grid(row=0, column=0)
        b2 = Button(self.page, text='查询信息', font='黑体', command=self.jump_2)
        b2.configure(width=30, height=8, fg='blue')
        b2.grid(row=0, column=1)
        b3 = Button(self.page, text='删除、修改信息', font='黑体')
        b3.configure(width=30, height=8, fg='green', command=self.jump_3)
        b3.grid(row=1, column=0)
        b4 = Button(self.page, text='关于系统', font='黑体')
        b4.configure(width=30, height=8, fg='black', command=self.jump_4)
        b4.grid(row=1, column=1)

    def jump_1(self):
        self.page.destroy()
        insertPage(self.root)

    def jump_2(self):
        self.page.destroy()
        searchPage(self.root)

    def jump_3(self):
        self.page.destroy()
        modifyPage(self.root)

    def jump_4(self):
        self.page.destroy()
        aboutPage(self.root)
